/**
 * @描述:<p> </p>
 *
 * @作者: 叶平平(yepp)
 *
 * @时间: 2011-7-30 上午12:36:17
 */
var JF = {
	keyCode : {
		ENTER : 13,
		ESC : 27,
		END : 35,
		HOME : 36,
		SHIFT : 16,
		TAB : 9,
		LEFT : 37,
		RIGHT : 39,
		UP : 38,
		DOWN : 40,
		DELETE : 46,
		BACKSPACE : 8
	},
	statusCode : {
		ok : 200,
		error : 300,
		timeout : 301
	},
	_msg : {},
	_set : {
		
	},
	jsonEval : function(json){
		try{
			return eval('('+json+')');
		}catch(e){
			return {};
		}
	},
	formParams : function(formId){
		if(formId == undefined){
			return ;
		}
		var data =new Array;
		
		$(formId).find(':input').each(function(i,n){
			var flag = 'false';
			if($(n).attr('param') == undefined){
				flag = 'true';
			}else{
				flag = $(n).attr('param');
			}
			if(flag == true || flag == 'true'){
				if (($(n).attr('type') == "checkbox" || $(n).attr('type') == "radio")&& $(n).attr('checked') == true) {
					putParam(n,data);	
				}else if($(n).attr('type') == "text" || $(n).attr('type') == "password" || $(n).attr('type') == "hidden" || $(n).attr('type') == "textarea"){
					putParam(n,data);
				}
			}
		});
		$(formId).find('select').each(function(i,n){
			var flag = 'false';
			if($(n).attr('param') == undefined){
				flag = 'true';
			}else{
				flag = $(n).attr('param');
			}
			if(flag == true || flag == 'true'){
				if($.trim($(n).attr('value')) != ''){
					putParam(n,data);
				}else{
					if($(n).attr('name') != ''){
						data.push({
							name : $(n).attr('name'),
							value : ''
						});
					}
				}
			}
		});
		return data;
	}
};
/**
 * 将表单数据放到数组中
 * */
function putParam(obj,dataList){
	if($(obj).attr('name') != ''){
		dataList.push({
			name : $(obj).attr('name'),
			value : $(obj).attr('value')
		});
	}
};
